package com.example.entity;

/**
 * com.example.entity.User
 *
 * @author ZRS
 * @version V1.0
 * @since 2025/10/30 21:01
 */

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("user") // 指定表名
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO) // 主键配置
    private Long id;

    @TableField("username") // 指定字段名
    private String username;

    @TableField("password")
    private String password;

    @TableField("email")
    private String email;

    @TableField(value = "create_time", fill = FieldFill.INSERT) // 自动填充
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) // 自动填充
    private LocalDateTime updateTime;

    @TableField("deleted")
    @TableLogic // 逻辑删除
    private Integer deleted;
}
